package client.comm.baoding.ui

import client.comm.baoding.BaseMiddleActivity
import client.comm.baoding.R
import client.comm.baoding.adapter.page.StoreIncomeFragmentPageAdapter
import client.comm.baoding.databinding.ActivityStoreIncomeBinding
import client.comm.baoding.ui.vm.ZcjlViewModel

/**
 * 店铺收益
 */
class StoreIncomeActivity : BaseMiddleActivity<ZcjlViewModel, ActivityStoreIncomeBinding>() {
    override fun getLayout(): Int {
        return R.layout.activity_store_income
    }

    val adapter: StoreIncomeFragmentPageAdapter by lazy {
        StoreIncomeFragmentPageAdapter(supportFragmentManager)
    }

    override fun initViewModel(): ZcjlViewModel = createViewModel()

    override fun initView() {
        binding.event = this
        binding.viewPager.adapter = adapter
        binding.tabLayout.setupWithViewPager(binding.viewPager)
//        when (intent.getIntExtra("index", 0)) {
//            0 -> {
////                binding.tabWrap.getChildAt(0).isSelected = true
//            }
//            1 -> {
//                binding.viewPager.postDelayed({
//                    binding.viewPager.setCurrentItem(1, false)
//                }, 20)
//            }
//            2 -> {
//                binding.viewPager.postDelayed({
//                    binding.viewPager.setCurrentItem(2, false)
//                }, 20)
//            }
//        }

    }

}